<h3 class="f14 mb5">订单记录</h3>
<p class="">
      近期订单<strong class="co ml2 mr2">{$new_count}</strong>笔/累计订单<strong class="co ml2 mr2">{$count}</strong>笔
</p>
<!-- 订单记录列表 -->
<table class="res_ord_his tc g6" cellpadding="0" cellspacing="0">
	<tr class="bgf5 g3">
        <th class="tl" width="120">预订人</th>
        <th><a href="javascript:set_store_order('create_time','{$sort}');" class="g3 fs" rel="nofollow">预订时间{if $field eq 'create_time'}{if $sort eq 'ASC'}↓{else}↑{/if}{/if}</a></th>
        <th><a href="javascript:set_store_order('status','{$sort}');" class="g3 fs" rel="nofollow">状态{if $field eq 'status'}{if $sort eq 'ASC'}↓{else}↑{/if}{/if}</a></th>
        <th><a href="javascript:set_store_order('order_money','{$sort}');" class="g3 fs" rel="nofollow">消费金额{if $field eq 'order_money'}{if $sort eq 'ASC'}↓{else}↑{/if}{/if}</a></th>
        <th><a href="javascript:set_store_order('order_nums','{$sort}');" class="g3 fs" rel="nofollow">就餐人数{if $field eq 'order_nums'}{if $sort eq 'ASC'}↓{else}↑{/if}{/if}</a></th>
        <th><a href="javascript:set_store_order('order_time','{$sort}');" class="g3 fs" rel="nofollow">就餐时间{if $field eq 'order_time'}{if $sort eq 'ASC'}↓{else}↑{/if}{/if}</a></th>
    </tr>
    {foreach from=$list item=item}
    <tr>
        <td class="tl">{$item.order_name}{if $item.order_sex eq 1}先生{else}女士{/if}</td>
        <td>{function name="to_date" v="$item.create_time" f="Y年m月d日"} {function name="to_date" v="$item.create_time" f="H时i分"}</td>
        <td>{if $item.status eq 0}已预订{else}已就餐{/if}</td>
        <td>{if $item.order_money}{$item.order_money}{else}-{/if}</td>
        <td>{$item.order_nums}</td>
        <td>{function name="to_date" v="$item.order_time" f="Y年m月d日"} {function name="to_date" v="$item.order_time" f="H时i分"}</td>
    </tr>
    {/foreach}
</table>
    
<div class="res_ord_page">
   <div class="pages">{$pages}</div>
</div>
<script type="text/javascript">
	function set_store_order(field,sort){
		var query = new Object();
		query.ctl = "view",
		query.act = "ajax_get_order"
		query.id = "{$id}";
		query.count = "{$count}";
		query.field = field;
		query.sort = sort;
		query.is_ajax = 1;
		query.p = "{$page}";
		$.ajax({
			url:APP_ROOT + "/store.php",
			data:query,
			type:"POST",
			dataType:"text",
			cache:false,
			success:function(result){
				$("#ul-store-order").html(result);
			}
		});
	}
	jQuery(function(){
		$("#ul-store-order .pages a").click(function(){
			var url = $(this).attr("href");
			$.ajax({
				url:url,
				dataType:"text",
				cache:false,
				success:function(result){
					$("#ul-store-order").html(result);
				}
			});
			return false;
		});
		
	});
</script>